package Demo;

import java.util.concurrent.Semaphore;

public class Demo24 {
    public static void main(String[] args) throws InterruptedException {
        Semaphore semaphore = new Semaphore(5);
        semaphore.acquire();
        semaphore.acquire();
        semaphore.acquire();
        semaphore.acquire();
        semaphore.acquire();
        System.out.println("此时信号量的许可数量为0");
        semaphore.acquire();

        semaphore.release();
    }
}
